package com.ebelter.myehc.models.http.response.device_resports;

import com.ebelter.btcomlib.models.https.responses.BaseResponse;
import com.ebelter.btcomlib.utils.GsonUtils;


public class DeviceResportParseJs {


    //1:血糖 2:血压 3:血氧 4:体温 5:尿酸 6:总胆固醇 7:人体成份 8:锻炼 9:心率 10:睡眠
    //1:年 2:月 3周: 4:天
    public static BaseResponse parseJs(BaseResponse srcBaseResponse,int measureType,String s){

        BaseResponse targetB = null;
        GsonUtils gson = GsonUtils.getInstance();

        if (measureType==1){
            targetB =gson.fromJson(s,BG_R.class);
        }else if (measureType==2){
            targetB =gson.fromJson(s,BP_R.class);
        }else if (measureType==3){
            targetB =gson.fromJson(s,BO_R.class);
        }else if (measureType==4){
            targetB =gson.fromJson(s,Temperature_R.class);
        }else if (measureType==5){
            targetB =gson.fromJson(s,Ua_R.class);
        }else if (measureType==6){
            targetB =gson.fromJson(s,Cholesterol_R.class);
        }else if (measureType==7){
            targetB =gson.fromJson(s,BC_R.class);
        }else if (measureType==8){
            targetB =gson.fromJson(s,BRA_DuanLian_R.class);
        }else if (measureType==9){
            targetB =gson.fromJson(s,BRA_XL_R.class);
        }else if (measureType==10){
            targetB =gson.fromJson(s,BRA_SHM_R.class);
        }


        if (targetB!=null){
            targetB.resultCode=srcBaseResponse.resultCode;
            targetB.responseStr=srcBaseResponse.responseStr;
            targetB.resultMessage=srcBaseResponse.resultMessage;
        }
        return targetB;
    }




}
